<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/hello', function () {
    return "hello world!";
});

//for home page
Route::get('/', 'indexController@index');

Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');

//for landowner
Route::get('/landowner', 'landOwnerController@index');
Route::get('/landowner/index', 'landOwnerController@index');
Route::get('/landowner/create', 'landOwnerController@create');
Route::get('/landowner/delete/{id}', 'landOwnerController@delete');
Route::get('/landowner/modify/{id}', 'landOwnerController@modify');
Route::get('/landowner/show/{id}', 'landOwnerController@show');
Route::get('/landowner/autocomplete', 'landOwnerController@autocomplete');


Route::post('/landowner/store', 'landOwnerController@store');
Route::post('/landowner/update', 'landOwnerController@update');

//for contract
Route::get('/contract', 'contractController@index');
Route::get('/contract/create', 'contractController@create');
Route::get('/contract/delete/{id}', 'contractController@delete');
Route::get('/contract/modify/{id}', 'contractController@modify');
Route::get('/contract/show/{id}', 'contractController@show');
Route::get('/contract/showByLandowner/{landowner_id}', 'contractController@showByLandowner');


Route::post('/contract/store', 'contractController@store');
Route::post('/contract/update', 'contractController@update');


//for land
Route::get('/land', 'landController@index');
Route::get('/land/create', 'landController@create');
Route::get('/land/json', 'landController@all');
Route::get('/land/delete/{id}', 'landController@delete');
Route::get('/land/modify/{id}', 'landController@modify');
Route::get('/land/show/{id}', 'landController@show');
Route::get('/land/showByLandowner/{landowner_id}', 'landController@showByLandowner');
Route::get('/land/showByContract/{contract_id}', 'landController@showByContract');
Route::get('/land/search/{team?}/{name?}', 'landController@search');


Route::post('/land/store', 'landController@store');
Route::post('/land/update', 'landController@update');




 
Auth::routes();

Route::get('/home', 'HomeController@index');
